<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件的触发</title>
    <style>
        #box{
            width: 100%;
            height: 100px;
            background-color: blue;
            font-size: 40px;
            line-height: 100px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div id="box" onmouseover="mousemove()" onmouseout="mousemove2()">今天是个好日子</div>
    <!--鼠标移上去用onmouseover   ；鼠标点击时用onclick -->
    <script>
        var o=document.getElementById('box');
        console.log(o);
        function mousemove() {
            o.style.backgroundColor = 'red';
        }
        function mousemove2() {
            o.style.backgroundColor = 'blue';
        }
       
    </script>
</body>
</html>